package com.hzw.saas.common.util;

import java.io.IOException;
import java.io.InputStream;

import lombok.experimental.UtilityClass;

/**
 * @author zzl
 * @since 07/01/2021
 */
@UtilityClass
public class IOUtil {

    public static void skip(InputStream ins, long skipBytes) throws IOException {
        skipBytes = skipBytes < 0 ? 0 : skipBytes;
        int as = 0;
        do {
            as += ins.skip(skipBytes - as);
        } while (as < skipBytes);
    }

}
